package geom

import "math"

type Projection struct {
	Min, Max float64
}

func (p *Projection) Cross(p2 Projection) float64 {
	return math.Min(p.Max, p2.Max) - math.Max(p.Min, p2.Min)
}

func (p *Projection) Into(p2 Projection) bool {
	return p.Min >= p2.Min && p.Max <= p2.Max
}
